<template>
<div>
    <div v-for="item in ArticleList" :key="item.id" >
        <router-link :to="{name:'essay',params:{id:item.id}}">
            <div class="ArticleList">
                <div class="title">{{item.title}}</div>
                <div class="ArticleContainer">
                    <div><img :src="item.cover"/></div>
                    <div v-text="item.subs.replace(/<[^>]+>/g, '')" id="ItemSubs"></div>
                </div>
            </div>
        </router-link>
    </div>
</div>
</template>
<script>
import { GetArticle } from "@/service/Api.js";
export default {
  name: "articlelist",
  data() {
    return {
        ArticleList:[],
    };
  },
  methods:{


  },
  created() { 
    let params = {
      include: "user",
    };
    GetArticle(params).then((res) => {
        this.ArticleList = res.data.writes
        console.log(res);

    });
  },
};
</script>
<style scoped>
.ArticleContainer{
    width: 90%;
    margin: auto;
}
a{
    color: #121212;
}

#ItemSubs{
    word-wrap: break-word;
    width: 80%;
    float: right;

}
.title{
    font-weight: 600;
    font-size: 18px;
    word-wrap: break-word;
    color: #222226;
    margin-top:12px;
    margin-bottom: 12px;
    width: 90%;
    margin: auto;

}
.ArticleList{

    background-color: #FFF;
    max-height: 300px;
    overflow: hidden;
    width: 100%;
    padding-bottom: 12px;
    padding-top: 12px;
    border-bottom: 1px solid #f0f2f7;
}
img{
    width: 20%;
    float: left;
}

</style>